const { contextBridge, ipcRenderer } = require('electron')

contextBridge.exposeInMainWorld('ipcRenderer', {
  send: (channel, data) => {
    let validChannels = ['toggle-full-screen','minimum','closeProgram'] // 配置合法消息名
    if (validChannels.includes(channel)) {
      ipcRenderer.send(channel, data)
    }
  },
  receive: (channel, func) => {
    let validChannels = ['toggle-full-screen','minimum','closeProgram']// 配置合法监听事件名称
    if (validChannels.includes(channel)) {
      ipcRenderer.on(channel, (event, ...args) => func(...args))
    }
  }
})
alert('1')//没弹窗就是失败了 成功后删除
